<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<%@ include file="/inc.jsp" %>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>闪耀先生-闪耀先生的礼品卡</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />    
    <!-- style -->
    <link href="${pageContext.request.contextPath }/vip/css/usercenter.css" rel="stylesheet">
  </head>
  <body>
    <div class="invitbox">
      <img src="${pageContext.request.contextPath }/vip/images/giftcard.jpg">
    </div><!--E .invitbox-->

<form action="${pageContext.request.contextPath}/public/vipAction!revGiftCard.action?openId=${fromOpenId}&code=${fromCode}" id="_formSub" method="post">
   
<div class="block buy text-center newpstyle">
      <h3>Mr.Shine设计师精选白色商务定制衬衫<p class="org">￥500</p></h3>
      
      <s:if test="#request.subMode == '00'   ">
	      <div class="btnbox getinfo">
		      <div class="inputbox">        
		        <ul>
		         <li><input type="text" id="name" name="name"
							placeholder="您的姓名" value="${name }"
							onblur="javascript:_changeClass();"></li>
						<li><input type="text" id="phone" name="phone"
							placeholder="手机号" value="${phone }"
							onblur="javascript:_changeClass();"></li>
		        </ul>
		      </div>
		      <div class="button">
		        <a href="##" onclick="_submit('${request.subMode}');" class="btn-org">接受<br>衬衫</a>
		      </div>
		    </div>  
      </s:if>
	  <s:else>
	      <div class="btnbox getinfo">
		      <div class="inputbox">        
		        <ul>
		         <li>该链接已经失效!</li>
		        </ul>
		      </div>
		    </div> 
	  </s:else>
			
      
     
    
       
    <p style="color:#333;border-bottom:0;">这是你的好友<span class="org">“${fromName }”</span>送给你的专属定制衬衫；点击接受，会有专属客服与你联系。</p>
</div><!--E .block-->
    </form>
  </body>

<script src="<%=basePath%>js/jquery-1.10.1.min.js"></script>  
 <script>
 function _changeClass(){
		var name = document.getElementById("name").value;
		var phone = document.getElementById("phone").value;
		if (name && phone) {
			$("#show").removeClass('graybg'); 
		}else{
			$("#show").addClass('graybg'); 
		}
		
	}
 function _submit(subMode){
	 if(subMode == "10"){
		 alert("该链接已经失效!");
	 }else {
			var name = document.getElementById("name").value;
			var phone = document.getElementById("phone").value;
			if (name && phone) {
				document.getElementById("_formSub").submit();
			} else {
				alert("姓名和手机号不能为空!");
			}
	}
 }
 </script>
</html>